#include <stdio.h>
#include "hash_table.h"
#include <limits.h>

void hashtable_test()
{
	int a;
	element *e;
	hashtable *pthis = create_hashtable(10);
	a = 32;
	e = create_element(&a,a,sizeof(a));
	chained_hash_insert(pthis,e);

	a = 4;
	e = create_element(&a,a,sizeof(a));
	chained_hash_insert(pthis,e);

	a = 14;
	e = create_element(&a,a,sizeof(a));
	chained_hash_insert(pthis,e);
	print_hash_data(pthis);

	e = chained_hash_search(pthis,13);
	if(e != NULL)
	{
		printf("\nFind key: %d:%d\n",e->key,*(int*)e->data);
	}
	else
	{
		printf("\nNot Find\n");
	}

	destroy_hashtable(pthis);
}

int main()
{
	int i;
	hashtable_test();

	//for(i=0;i<10000;i++)
	//	hashtable_test();

	printf("%d\n",CHAR_BIT);
}